/**
 * 作者：I-AM-WASTE
 * TIME:2022-10-12
 */

let v = new Vue({
    el:"#nrbody",
    data:{
        artWord:{
            id:'',
            gameTitle:'',
            gameDownload:'',
            gameLook:'',
            gameFl:'',
            gameUptime:'',
        }
    },
    created:function (){
        axios.post("/back/index").then(function (response){
            v.artWord = response.data
        })
    },
    methods:{
        page(index){
            axios.post("/back/index/"+index).then(function (response){
                v.artWord = response.data
            })
        },
        del(index){
            axios.post("/back/delete/"+index).then(function (response){
                if (response.data === 'ok'){
                    v.$Message.success({
                        content: "删除成功！祝贺",
                        duration: 3
                    });
                }else {
                    v.$Message.error({
                        content: "服务器娘发生错误(っ °Д °;)っ",
                        duration: 3
                    });
                }
            })
        }
    }
})


let z = new Vue({
    el:"#hander-finx",
    data:{
        i:null
    },
    methods: {
        loginout(){
            axios.post("/loginout").then(function (response){
                z.$Message.success({
                    content: "退出成功！（；´д｀）ゞ",
                    duration: 3
                });
                this.i = setTimeout(()=>{
                    //需要延迟的代码 :3秒后延迟跳转到首页，可以加提示什么的
                    window.location.href = "/login"
                    //延迟时间：3秒
                },3000)
            })
        }
    },
    beforeDestroy(){
        clearTimeout(this.i)
    }
})

let year = document.getElementById("newyear")
year.innerText = ""+new Date().getFullYear()+""